# u = "PHPSESSID=5c2f05bd5b4b272f5ce037cb50536a48; path=/, verify_phone18668032351=3538; expires=Thu, 26-Feb-2015 10:08:09 GMT"
#
# import re
#
# r = re.search(r'verify_phone\d{11}=\d{4}', u)
# if r:
# 	print(r.group(0).split("=")[1])

num = 7
count = 0

while num > 0:
    if num % 2 == 0:
        num /= 2
    elif num % 3 == 0:
        num /= 3
    else:
        num -= 1
    count += 1

print count